package com.efesco.finance.oughtReceive;

import com.bstek.dorado.data.*;
import com.bstek.dorado.view.data.ViewBaseField;
import com.bstek.dorado.common.*;
import com.efesco.common.Tools;
import com.efesco.system.User;

/**
 * queryPayment_conditionDatasetListener
 */
public class queryPayment_conditionDatasetListener extends
		AbstractDatasetListener {
	public void afterLoadData(Dataset dataset) throws Exception {
		DoradoContext context = DoradoContext.getContext();
		Object obj = context.getAttribute(context.SESSION, "User");
		if (obj != null) {
			User user = (User) obj;
			String singleCompanyId = Tools.toStr(user.getSingleCompanyId());
			int roleType = user.getRoleType();
			if (!singleCompanyId.equals("") && roleType == 3 ) {
				ViewBaseField field = (ViewBaseField) dataset
						.getField("businessmanName");
				field.setVisible(false);
				field = (ViewBaseField) dataset.getField("companyName");
				field.setVisible(false);
				dataset.insertRecord();
				dataset.setString("singleCompanyId", singleCompanyId);
			}

		}
	}

}